<?php


namespace App\Http\Controllers;

use App\Services\CityService;

/**
 * 城市管理-控制器
 * @author aaron
 * @since 2020/11/11
 * Class CityController
 * @package App\Http\Controllers
 */
class CityController extends BaseController
{
    public function __construct()
    {
        parent::__construct();
        $this->service = new CityService();
    }

    /**
     * @OA\Get(
     *     path="/city/index",
     *     tags={"City"},
     *     summary="获取省市县数据(pid表示上级ID，不传PID表示获取省份，以此类推)",
     *     description="获取部门数据",
     *     operationId="city_index",
     *     security={{"bearerAuth":{}}},
     *     @OA\Parameter(name="pid", in="query", description="父级ID", required=false, @OA\Schema(default="", type="integer")),
     *     @OA\Response(response=200, description="请求成功"),
     *     @OA\Response(response=401,description="鉴权失败"),
     *     @OA\Response(response=422, description="请求异常")
     * )
     */
    public function index()
    {
        $result = $this->service->getList();
        return $result;
    }
}
